from typing import *


class Solution:
    def minRectanglesToCoverPoints(self, points: List[List[int]], w: int) -> int:
        points.sort(key=lambda a: a[0])
        ans, r = 0, -1
        for x, _ in points:
            if x > r:
                ans += 1
                r = x + w
        return ans
